﻿//*** Guidance generated code ***//
using System;
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.IO;
using System.Linq;

using ProjectBase.Core;

namespace $safeprojectname$.Services
{
    /// <summary>
    ///     Entity Attachment.
    /// </summary>
    [Serializable]
    public class Attachment : Persistent<string>
    {
        public override string ID
        {
            get { return Name; }
            protected set { Name = value; }
        }

        public virtual string FullName { get; set; }
        public virtual string Name { get; set; }
        public virtual string Suffix { get; set; }
        public virtual string RelativePath { get; set; }
        public virtual Stream InputStream { get; set; }

        public virtual Article Article { get; set; }
        public virtual ContentType ContentType { get; set; }

        #region override abstract
        /// <summary>
        ///     Provides quick, string description about the 'Attachment' instance
        /// </summary>
        public override string ToDisplay()
        {
            return IDToDisplay;
        }

        /// <summary>
        ///     Returned value should be handled as business unique key.
        ///     Equal method (implemented in Tracked base class) will use it
        ///     to compare two Attachments
        /// </summary>
        protected override string GetDomainObjectSignature()
        {
            return IDToDisplay;
        }
        #endregion override abstract
    }
}